<template>
  <div id="player">
      <!-- <h2 class="title">黑云音乐</h2> -->
      <!-- 轮播图 -->
      <Swiper></Swiper>
      <div class="search">
        <!-- 搜索框 双向数据绑定 -->
        <input type="text" v-model.trim="keyword" @keyup.enter="gotoResult"/>
        <button @click="gotoResult">
          <span class="iconfont icon-search"></span>
        </button>
      </div>
      <div class="tab-wrapper">
        <!-- tab栏 -->
        <div class="tab-bar">
          <router-link to="/results/神话" class="bar-item" active-class="active">搜索结果</router-link>
          <router-link to="/player/1301573116" class="bar-item"
          active-class="active">歌曲播放</router-link>
          <router-link to="/mv/1301573116" class="bar-item" active-class="active">MV</router-link>
          <router-link to="/comment/1301573116" class="bar-item" active-class="active">歌曲评论</router-link>
        </div>
        <!-- 对应的内容区域 -->
        <div class="tab-content">

        </div>
      </div>
    </div>
</template>

<script>
import Swiper from "./Swiper.vue";
export default {
  components:{
    Swiper
  },
  data(){
    return{
      //音乐搜索关键字
      keyword: ''
    }
  },
  methods:{
    // 搜索点击跳转到 搜索结果页面
    gotoResult(){
      window.localStorage.setItem("keyword", this.keyword)
      this.$router.push('/results/'+this.keyword)
    }
  },
  
  
};
</script>

<style scoped>
@import "@/assets/css/index.css";
</style>